<template>
<div v-html="replacedHtml"></div>
</template>

<script>
// html显示封装
export default {
  computed:{
    replacedHtml(){
      var html=this.html
      var value=this.value
      if(html==null || html==undefined){
        html=""
      }
      if(value==null || value==undefined){
        value=""
      }
      html=html.replace("{0}",value)
      for (var k in this.row){
        var v=this.row[k]
        var p="{"+k+"}"
        // console.log(p);
        html=html.replace(p,v)
      }
      return html
    }
  },
  name:"rawHtml",
  props:['html','value','row']
}
</script>

<style>

</style>